<template>
  <div class="right-menu">
    <ul>
      <li v-if="has('delete')">删除</li>
      <li v-if="has('edit')">编辑</li>
      <li v-if="has('update')">修改</li>
    </ul>
  </div>
</template>

<script setup lang="ts">
import { PropType } from "vue"

type ListItemType = "delete" | "edit" | "update"
const props = defineProps({
  operableList: {
    type: Array as PropType<ListItemType[]>
  }
})
const has = (item: ListItemType) => {
  return props.operableList?.includes(item)
}
</script>

<style scoped></style>
